{% extends "base.html" %}

{% block header%}
<title>物料列表</title>
{% endblock %}

{% block content %}
{% with model_name='Material' url_prefix='/pack/material/material_detail' %}
<script type="text/javascript">
    var request_url = '/pack/material/material',
        ColumnDefs = [
            {
                "aTargets": [3],
                "sWidth":"22%",
            },
            {
                "aTargets": [5],
                "sWidth":"10%",
                "mData": function (source) {
                    return "<a href='{{url_prefix}}?id=" + source[5] +
                                            "' class='openDialog'>修改配置</a>"
                }
            },

    ];
	function add{{model_name}}(ele) {
		art.dialog.open("{{url_prefix}}")
	}

</script>

{% include 'query/plugins/search_form.html' %}

<div >
	<ul id="nav-list" class="nav nav-tabs" >
			  <li class="active"  >
			  	<a>物料列表</a>
			  </li>
	</ul>
	<!-- 按钮工具条 -->
	<div id='datatable_toolbar'>
		<div class="btn-toolbar pull-right">
			<div class="btn-group ">
				<a class="btn btn-sm btn-success " onclick="add{{model_name}}(this)">
					<i class="icon-plus-sign"></i>添加
				</a>
			</div>
		</div>
	</div>
	<table id="{{model_name}}_table" class="table table-bordered datatable" data-toolbar='datatable_toolbar' data-group-by-index='[5]'>
		<thead>
		<tr>
			<th>项目</th>
			<th>渠道(SDK)</th>
			<th>平台</th>
			<th>物料名称</th>
			<th>创建时间</th>
			<th>操作</th>
		</tr>
		</thead>
		<tbody id="{{model_name}}_area"></tbody>
	</table>
</div>
{% endwith %}
{% endblock %}
